<div class="clearfix" style="padding:0 18px">
    <span class="lnk frt" onclick="$('sms-info-panel').toggleClass('hide')">
        <{t}>隐藏\显示 短信平台简介<{/t}>
    </span>
</div>
<div style="text-align:right;padding:3px 18px">
    <{help docid="100" type="link"}>
        <{t}>点击查看帮助<{/t}>
    <{/help}>
</div>
<div class="note"  id="sms-info-panel" style="margin:5px 18px">
    <{$sms_brief}>
</div>

<{if $settings}>
<div class="tableform">
    <form  action="index.php?app=ectools&ctl=admin_messenger_config&act=setting&p[0]=<{$classname}>&p[1]=<{$smskey}>" id="messenger-cfgs-settings-form" method="post">
        <input type="hidden" name="finder_id" value="<{$env.get.finder_id}>">
        <div class="division">
            <table width="100%" cellspacing="0" cellpadding="0">
                <tbody>
                <{foreach from=$settings item=setting_item key=key}>
                    <tr>
                        <th>
                        <{if $setting_item.type != 'hidden'}>
                            <label for="dom_el_<{$key}>"><{$setting_item.title}></label>
                        <{else}>
                            &nbsp;
                        <{/if}>
                        </th>
                        <td>
                        <{if $setting_item.type == 'string' || $setting_item.type == 'float'}>
                            <input type="text" <{if $setting_item.validate_type}>vtype="<{$setting_item.validate_type}>"<{/if}> id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> value="<{$setting_item.value}>" title="<{$setting_item.title}>" class="x-input " autocomplete="off">
                        <{elseif $setting_item.type == 'pecentage'}>
                            <input type="text" <{if $setting_item.validate_type}>vtype="<{$setting_item.validate_type}>"<{/if}> id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> value="<{$setting_item.value}>" title="<{$setting_item.title}>" class="x-input " autocomplete="off">%
                        <{elseif $setting_item.type == 'file'}>
                            <{if $setting_item.value == "" }>
                                <input type="file" <{if $setting_item.validate_type}>vtype="<{$setting_item.validate_type}>"<{/if}> id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> title="<{$setting_item.title}>">
                            <{else}>
                                <input type="text" id="dom_el_<{$key}>" name="setting[<{$key}>]" value="<{$setting_item.value}>" title="<{$setting_item.title}>">
                            <{/if}>
                        <{elseif $setting_item.type == 'radio'}>
                            <{foreach from=$setting_item.options item=option_item key=option_key}>
                                <input type="radio" id="dom_el_<{$key}>-<{$option_key}>" title="<{$setting_item.title}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> includebase="1"<{if $setting_item.value==$option_key}> checked="checked"<{/if}> value="<{$option_key}>"><label for="dom_el_<{$key}>-<{$option_key}>"><{$option_item}></label>&nbsp;
                            <{/foreach}>
                        <{elseif $setting_item.type == 'select'}>
                            <select class=" x-input-select inputstyle" id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> type="select" title="<{$setting_item.title}>">
                            <{foreach from=$setting_item.options item=option_item key=option_key}>
                                <option value="<{$option_key}>"<{if $setting_item.value == $option_key}> selected="selected"<{/if}>><{$option_item}></option>
                            <{/foreach}>
                            </select>
                        <{elseif $setting_item.type == 'text hidden'}>
                            <{if $setting_item.options}>
                                <{foreach from=$setting_item.options item=option_item key=option_key}>
                                    <{if $setting_item.value == $option_key}><{$option_item}><{break;}><{/if}>
                                <{/foreach}>
                            <{/if}>
                            <input type="hidden" id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> value="<{$setting_item.value}>" class="x-input " autocomplete="off">
                        <{elseif $setting_item.type == 'text hidden cur'}>
                            <{$setting_item.cur_value}>
                            <input type="hidden" id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> value="<{$setting_item.value}>" class="x-input " autocomplete="off">
                        <{elseif $setting_item.type == 'hidden'}>
                            <input type="hidden" id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> value="<{$setting_item.value}>" class="x-input " autocomplete="off">
                        <{elseif $setting_item.type == 'html'}>
                            <{input type='html' id="dom_el_{$key}" value=$setting_item.value name="setting[{$key}]" includeBase='true'}>
                        <{elseif $setting_item.type == 'textarea'}>
                            <textarea id="dom_el_<{$key}>" <{if $setting_item.name}>name="<{$setting_item.name}>"<{else}>name="setting[<{$key}>]"<{/if}> <{if $setting_item.cols}>cols="<{$setting_item.cols}>"<{else}>cols="88"<{/if}>  <{if $setting_item.rows}>rows="<{$setting_item.rows}>"<{else}>rows="6"<{/if}> ><{$setting_item.value}></textarea>
                        <{/if}>
                        </td>
                    </tr>
                <{/foreach}>
                </tbody>
            </table>
        </div>
    </form>
</div>
<!-- area用于浮动操作栏 -->
<{area inject=".mainFoot"}>
<div class="table-action">
    <table width="100%" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td><{button id="messenger-cfgs-settings-form-btn" class="btn-primary" type="submit" label=$___ectools="确定"|t:'ectools'}></td>
            </tr>
        </tbody>
    </table>
</div>
<{/area}>
<script>
(function(){
    var _form = $('messenger-cfgs-settings-form');
    var btn =$('messenger-cfgs-settings-form-btn');
    var _dialog = btn.getParent('.dialog');
    _form.store('target',{
        onComplete:function(re){
            re = JSON.decode(re);
            if(re.error){
                return;
            }
            try{
                var _dialogIns = _dialog.retrieve('instance');
            }catch(e){}
            if(_dialogIns){
                _dialogIns.close();
            }
        }
    });
    btn.addEvent('click',function(){
        _form.fireEvent('submit',{stop:$empty});
    });
})();
</script>
<{/if}>